torsional_spring Derived Type

type, public, extends(torsional_force_element) :: torsional_spring

Defines a linear torsional spring about a revolute-joint axis.


Contents


Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: free_angle = 0.0d0

The zero-torque relative joint angle, in radians.

integer(kind=int32), public :: joint_index = 0

The one-based revolute-joint index whose axis the element uses.

real(kind=real64), public :: stiffness = 0.0d0

The torque per unit angular displacement.


Type-Bound Procedures

procedure, public :: evaluate_torque => torsional_spring_torque

  • private pure function torsional_spring_torque(this, angle, angle_rate) result(rst)

    Evaluates the restoring torque produced by a linear torsional spring.

    Arguments

    Type IntentOptional Attributes Name
    class(torsional_spring), intent(in) :: this

    The spring whose stiffness and free angle define the torque law.

    real(kind=real64), intent(in) :: angle

    The relative joint angle and angular rate. The rate is unused by a torsional spring.

    real(kind=real64), intent(in) :: angle_rate

    The relative joint angle and angular rate. The rate is unused by a torsional spring.

    Return Value real(kind=real64)

    The signed torque applied to the child body about the joint axis.